package br.unifor.g2cl.hl.listener;

import br.unifor.g2cl.hl.StateTransferDataSession;


/**
 * 
 * Used in conjuction with the {@link StateTransferDataSession}, must be used to specify how the state will be exchanged between the
 * members of the group.
 *  
 * 
 * @author Leandro Sales (leandro.shp@gmail.com)
 *
 */
public interface StateListener {
	
	/** Provides the group state to another member */
	byte[] stateOutgoing();
	
	/**
	 * Specify how a state will be installed to a member
	 * @param state
	 */
	void stateIncoming(byte[] state);
	
	/**
	 * Flag that indicates if this member already has the current state.
	 */
	boolean hasState();
}
